package router

import (
	"github.com/gin-gonic/gin"
	"mouth-project/controller"
)

func Router(router *gin.Engine) {

	v1 := router.Group("/v1")
	{ //用户组
		UserGroup := v1.Group("./user")
		{ //注册
			UserGroup.POST("/userRegister", controller.UserRegister)
			UserGroup.POST("/userLogin", controller.UserLogin)
		}
		//商品组
		GoodsGroup := v1.Group("./goods")
		{ //商品发布
			GoodsGroup.POST("/goodsCreate", controller.GoodsCreate)
			//商品详情
			GoodsGroup.POST("/goodsInfo", controller.GoodsInfo)
			//评论
			GoodsGroup.POST("/comment", controller.Comment)
		}
		//订单组
		OrderGroup := v1.Group("./order")
		{ //订单创建
			OrderGroup.POST("/orderCreate", controller.OrderCreate)
			//订单详情
			OrderGroup.POST("/orderDetails", controller.OrderDetails)
		}
		//文件上传
		v1.POST("/upload", controller.Upload)
		//客服聊天
		v1.GET("/chat", controller.Chat)
		v1.GET("/chatDelete", controller.Delete)
	}
}
